﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};

	var applystatusData = Jxstar.findComboData('applystatus');
	var authtypeData = Jxstar.findComboData('authtype');
	var moneytypeData = Jxstar.findComboData('moneytype');
	var purtypeData = Jxstar.findComboData('purtype');
	var orgtypeData = Jxstar.findComboData('orgtype');

	var cols = [
	{col:{header:'采购单号', width:139, sortable:true}, field:{name:'pur_apply__apply_code',type:'string'}},
	{col:{header:'采购状态', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: applystatusData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: applystatusData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < applystatusData.length; i++) {
				if (applystatusData[i][0] == value)
					return applystatusData[i][1];
			}
		}}, field:{name:'pur_apply__apply_status',type:'string'}},
	{col:{header:'项目编号', width:100, sortable:true}, field:{name:'pur_apply__project_code',type:'string'}},
	{col:{header:'项目名称', width:274, sortable:true}, field:{name:'pur_apply__project_name',type:'string'}},
	{col:{header:'授权形式', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: authtypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: authtypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < authtypeData.length; i++) {
				if (authtypeData[i][0] == value)
					return authtypeData[i][1];
			}
		}}, field:{name:'pur_apply__auth_type',type:'string'}},
	{col:{header:'投资计划编号', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__plan_code',type:'string'}},
	{col:{header:'项目主要内容', width:100, sortable:true}, field:{name:'pur_apply__project_content',type:'string'}},
	{col:{header:'中标金额(万元)', width:100, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'pur_apply__bid_money',type:'float'}},
	{col:{header:'选中供应商', width:100, sortable:true}, field:{name:'pur_apply__provider_name',type:'string'}},
	{col:{header:'中标日期', width:100, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m-d') : '';
		}}, field:{name:'pur_apply__bid_date',type:'date'}},
	{col:{header:'项目类别', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: moneytypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: moneytypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < moneytypeData.length; i++) {
				if (moneytypeData[i][0] == value)
					return moneytypeData[i][1];
			}
		}}, field:{name:'pur_apply__money_type',type:'string'}},
	{col:{header:'预算金额(万元)', width:100, sortable:true, renderer:JxUtil.formatNumber(6)}, field:{name:'pur_apply__project_money',type:'float'}},
	{col:{header:'实施单位', width:100, sortable:true}, field:{name:'pur_apply__dept_name',type:'string'}},
	{col:{header:'记录状态', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__auditing',type:'string'}},
	{col:{header:'主管部门', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__done_deptname',type:'string'}},
	{col:{header:'项目负责人', width:100, sortable:true}, field:{name:'pur_apply__project_user',type:'string'}},
	{col:{header:'采购方式', width:100, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: purtypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false, allowBlank:false,
			value: purtypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < purtypeData.length; i++) {
				if (purtypeData[i][0] == value)
					return purtypeData[i][1];
			}
		}}, field:{name:'pur_apply__pur_type',type:'string'}},
	{col:{header:'申请人', width:100, sortable:true}, field:{name:'pur_apply__apply_user',type:'string'}},
	{col:{header:'申请日期', width:100, sortable:true, renderer:function(value) {
			return value ? value.format('Y-m-d') : '';
		}}, field:{name:'pur_apply__apply_date',type:'date'}},
	{col:{header:'批复金额(万元)', width:100, sortable:true, hidden:true, renderer:JxUtil.formatNumber(6)}, field:{name:'pur_apply__plan_money',type:'float'}},
	{col:{header:'组织形式', width:100, sortable:true, hidden:true, align:'center',
		renderer:function(value){
			for (var i = 0; i < orgtypeData.length; i++) {
				if (orgtypeData[i][0] == value)
					return orgtypeData[i][1];
			}
		}}, field:{name:'pur_apply__org_type',type:'string'}},
	{col:{header:'代理机构名称', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__proxy_org',type:'string'}},
	{col:{header:'采购内容', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__pur_content',type:'string'}},
	{col:{header:'申请理由', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__pur_cause',type:'string'}},
	{col:{header:'备注', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__pur_memo',type:'string'}},
	{col:{header:'项目批复文号', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__check_fileno',type:'string'}},
	{col:{header:'项目批复名称', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__check_name',type:'string'}},
	{col:{header:'项目ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__project_id',type:'string'}},
	{col:{header:'项目负责人ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__project_userid',type:'string'}},
	{col:{header:'选中供应商ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__provider_id',type:'string'}},
	{col:{header:'申请人ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__apply_userid',type:'string'}},
	{col:{header:'主管部门ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__done_deptid',type:'string'}},
	{col:{header:'主键', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__apply_id',type:'string'}},
	{col:{header:'实施单位ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__dept_id',type:'string'}},
	{col:{header:'投资计划ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__plan_id',type:'string'}},
	{col:{header:'采购单名称', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__apply_name',type:'string'}},
	{col:{header:'采购单方案申请ID', width:100, sortable:true, hidden:true}, field:{name:'pur_apply__check_id',type:'string'}}
	];
	
	config.param = {
		cols: cols,
		sorts: null,
		hasQuery: '1',
		isedit: '0',
		isshow: '1',
		funid: 'purchase_modify'
	};
	
	
		
	return new Jxstar.GridNode(config);
}